<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        var pa = [100, 232, 54, 34, 7, 2];
        var max = pa[0];
        var min = pa[0];
         console.log(pa);
        for (var w = 0; w < pa.length; w++) { 
            if(max<pa[w]){
                max=pa[w];
            }
            if(min>pa[w]){
                min=pa[w];
            } 
        }
        console.log("最大值是：" +max);
        console.log("最小值是：" +min);
    </script>
</body>
</html>